package com.cloudbroker.openapi.manage.controller;

import static com.cloudbroker.bcs.platform.dav.common.util.RequestUtil.getSingleParameterMapForBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.cloudbroker.bcs.common.entity.HSBCPSBackVO;
import com.cloudbroker.bcs.common.util.VOUtil;
import com.cloudbroker.bcs.platform.dav.bizapi.service.base.vo.PageVO;
import com.cloudbroker.bcs.platform.dav.bizapi.service.business.adpage.result.AdpageListResult;
import com.cloudbroker.bcs.platform.dav.bizapi.service.business.adpage.result.BrokerListData;
import com.cloudbroker.bcs.platform.dav.bizapi.service.business.adpage.result.TenantListData;
import com.cloudbroker.bcs.platform.dav.bizapi.service.business.customer.back.LoginFormBackForm;
import com.cloudbroker.bcs.platform.dav.bizapi.service.business.customer.back.SuggestionBackList;
import com.cloudbroker.bcs.platform.dav.bizapi.service.business.customer.back.UserCountBackForm;
import com.cloudbroker.bcs.platform.dav.bizapi.service.business.customer.vo.BrokerLoggerForm;
import com.cloudbroker.bcs.platform.dav.bizapi.service.business.customer.vo.BrokerRegForm;
import com.cloudbroker.bcs.platform.dav.bizapi.service.business.customer.vo.UserCountForm;
import com.cloudbroker.bcs.platform.dav.bizapi.service.business.system.back.SelfViewpointResult;
import com.cloudbroker.bcs.platform.dav.bizapi.service.business.system.vo.SelfViewpointForm;
import com.cloudbroker.bcs.platform.dav.bizapi.service.business.system.vo.SelfViewpointReviewForm;
import com.cloudbroker.bcs.platform.dav.bizapi.service.business.system.vo.SelfViewpointStatusForm;
import com.cloudbroker.bcs.platform.dav.bizapi.service.business.system.vo.ViewPointReviewForm;
import com.cloudbroker.bcs.platform.dav.bizapi.service.business.system.vo.ViewpointReviewManage;
import com.cloudbroker.bcs.platform.dav.bizapi.service.business.system.vo.ViewpointReviewManageForm;
import com.cloudbroker.bcs.platform.dav.bizapi.service.operate.result.BrokerLoggerListResult;
import com.cloudbroker.bcs.platform.dav.bizapi.service.operate.result.ChatContentResult;
import com.cloudbroker.bcs.platform.dav.bizapi.service.operate.result.ChatListResult;
import com.cloudbroker.bcs.platform.dav.bizapi.service.operate.result.ChatMsgResult;
import com.cloudbroker.bcs.platform.dav.bizapi.service.operate.result.OperateBranchListResult;
import com.cloudbroker.bcs.platform.dav.bizapi.service.operate.result.OperateGetFansBackResult;
import com.cloudbroker.bcs.platform.dav.bizapi.service.operate.vo.AdpageListOperateForm;
import com.cloudbroker.bcs.platform.dav.bizapi.service.operate.vo.AdpageUpdateOperateParam;
import com.cloudbroker.bcs.platform.dav.bizapi.service.operate.vo.BranchNoForm;
import com.cloudbroker.bcs.platform.dav.bizapi.service.operate.vo.BranchNoPageForm;
import com.cloudbroker.bcs.platform.dav.bizapi.service.operate.vo.ChatBatchDelForm;
import com.cloudbroker.bcs.platform.dav.bizapi.service.operate.vo.ChatContentForm;
import com.cloudbroker.bcs.platform.dav.bizapi.service.operate.vo.ChatContentInfoForm;
import com.cloudbroker.bcs.platform.dav.bizapi.service.operate.vo.OperateFansBlockForm;
import com.cloudbroker.bcs.platform.dav.bizapi.service.operate.vo.OperateFansGagForm;
import com.cloudbroker.bcs.platform.dav.bizapi.service.operate.vo.OperateGetFansForm;
import com.cloudbroker.bcs.platform.dav.bizapi.service.viewpoint.result.ViewpointCommentOperateList;
import com.cloudbroker.bcs.platform.dav.bizapi.service.viewpoint.result.ViewpointManangeResult;
import com.cloudbroker.bcs.platform.dav.bizapi.service.viewpoint.result.ViewpointOperateList;
import com.cloudbroker.bcs.platform.dav.bizapi.service.viewpoint.result.ViewpointReviewData;
import com.cloudbroker.bcs.platform.dav.bizapi.service.viewpoint.vo.ViewpointCommentOperateDeleteForm;
import com.cloudbroker.bcs.platform.dav.bizapi.service.viewpoint.vo.ViewpointCommentOperateListForm;
import com.cloudbroker.bcs.platform.dav.bizapi.t2service.operate.ChatManageT2BizService;
import com.cloudbroker.bcs.platform.dav.bizapi.t2service.operate.OperateBrokerT2BizService;
import com.cloudbroker.bcs.platform.dav.bizapi.t2service.operate.OperateFansT2BizService;
import com.cloudbroker.bcs.platform.dav.bizapi.t2service.operate.ViewpointManageT2BizService;
import com.cloudbroker.bcs.platform.dav.common.ext.annotation.SaveLog;

/**
 * Created by wangxu13798 on 2016/8/24.
 */
@Controller
public class OperateController {
    @Resource
    private OperateFansT2BizService operateFansT2BizService;
    
    @Resource
    private OperateBrokerT2BizService operateBrokerT2;

    @Resource
    private ViewpointManageT2BizService viewpointManageT2;

    @Resource
    private ChatManageT2BizService chatManageT2;
    /**
     *运营端查询粉丝列表
     */
    @ResponseBody
    @RequestMapping("/func_operate_get_fans")
    @SaveLog(remark = "运营端查询粉丝列表")
    public OperateGetFansBackResult funcOperateGetFans(HttpServletRequest request, String jsonpcallback){
        OperateGetFansForm form = getSingleParameterMapForBody(request,OperateGetFansForm.class);
        return VOUtil.setJsonpResult(operateFansT2BizService.funcOperateGetFans(form),jsonpcallback);
    }

    /**
     *运营端粉丝禁言/取消
     */
    @ResponseBody
    @RequestMapping("/func_operate_fans_gag")
    @SaveLog(remark = "运营端粉丝禁言/取消")
    public HSBCPSBackVO funcOperateFansGag(HttpServletRequest request, String jsonpcallback){
        OperateFansGagForm form = getSingleParameterMapForBody(request,OperateFansGagForm.class);
        return VOUtil.setJsonpResult(operateFansT2BizService.funcOperateFansGag(form),jsonpcallback);
    }

    /**
     *运营端粉丝拉黑/取消
     */
    @ResponseBody
    @RequestMapping("/func_operate_fans_block")
    @SaveLog(remark = "运营端粉丝拉黑/取消")
    public HSBCPSBackVO funcOperateFansBlock(HttpServletRequest request, String jsonpcallback){
        OperateFansBlockForm form = getSingleParameterMapForBody(request,OperateFansBlockForm.class);
        return VOUtil.setJsonpResult(operateFansT2BizService.funcOperateFansBlock(form),jsonpcallback);
    }

    /**
     *获取归属地列表
     */
    @ResponseBody
    @RequestMapping("/func_get_branch_list")
    @SaveLog(remark = "获取归属地列表")
    public OperateBranchListResult funcGetBranchList(HttpServletRequest request, String jsonpcallback){
        BranchNoForm form = getSingleParameterMapForBody(request,BranchNoForm.class);
        return VOUtil.setJsonpResult(operateFansT2BizService.funcGetBranchList(form),jsonpcallback);
    }

    /**
     * 管理中台大V注册
     */
    @ResponseBody
    @RequestMapping("/func_operate_broker_register")
    @SaveLog(remark = "管理中台大V注册")
    public LoginFormBackForm funcOperateBrokerRegister(HttpServletRequest request, String jsonpcallback) {
        BrokerRegForm form = getSingleParameterMapForBody(request , BrokerRegForm.class);
        return VOUtil.setJsonpResult(operateFansT2BizService.funcOperateBrokerRegister(form), jsonpcallback);
    }

    /**
     * 运营端大V列表
     * @param request
     * @return
     */
    @ResponseBody
    @RequestMapping("/func_operate_broker_list")
    @SaveLog(remark = "运营端获取大V列表")
    public BrokerListData funcOperateBrokerList(HttpServletRequest request , String jsonpcallback){
        BranchNoForm form = getSingleParameterMapForBody(request , BranchNoForm.class);
        return VOUtil.setJsonpResult(operateFansT2BizService.funcOperateBrokerList(form), jsonpcallback);
    }

    /**
     * 运营端获取租户列表
     * @param request
     * @return
     */
    @ResponseBody
    @RequestMapping("/func_operate_tenant_list")
    @SaveLog(remark = "运营端获取租户列表")
    public TenantListData funcOperateTenantList(HttpServletRequest request , String jsonpcallback){
        BranchNoForm form = getSingleParameterMapForBody(request , BranchNoForm.class);
        return VOUtil.setJsonpResult(operateFansT2BizService.funcOperateTenantList(form), jsonpcallback);
    }

    /**
     * 运营端获取广告页列表
     * @param request
     * @return
     */
    @ResponseBody
    @RequestMapping("/func_operate_adpage_list")
    @SaveLog(remark = "运营端获取广告页列表")
    public AdpageListResult funcOperateAdpageList(HttpServletRequest request , String jsonpcallback){
        AdpageListOperateForm form = getSingleParameterMapForBody(request , AdpageListOperateForm.class);
        return VOUtil.setJsonpResult(operateFansT2BizService.funcOperateAdpageList(form), jsonpcallback);
    }

    /**
     * 运营端广告页修改
     * @param request
     * @return
     */
    @ResponseBody
    @RequestMapping("/func_operate_adpage_update")
    @SaveLog(remark = "运营端广告页修改")
    public HSBCPSBackVO funcOperateAdpageUpdate(HttpServletRequest request , String jsonpcallback){
        AdpageUpdateOperateParam form = getSingleParameterMapForBody(request , AdpageUpdateOperateParam.class);
        return VOUtil.setJsonpResult(operateFansT2BizService.funcOperateAdpageUpdate(form), jsonpcallback);
    }
    
    /**
     * 意见列表
     * */
    @ResponseBody
    @RequestMapping("/func_suggestion_list")
    @SaveLog(remark = "意见列表")
    public SuggestionBackList funcSuggestionList(HttpServletRequest request, String jsonpcallback) {
        PageVO form = getSingleParameterMapForBody(request, PageVO.class);
        return VOUtil.setJsonpResult(operateFansT2BizService.funcSuggestionList(form), jsonpcallback);
    }
    
    /**
     * 用户数据统计
     * */
    @ResponseBody
    @RequestMapping("/func_user_count")
    @SaveLog(remark = "用户数据统计")
    public UserCountBackForm funcUserCount(HttpServletRequest request, String jsonpcallback) {
        UserCountForm form = getSingleParameterMapForBody(request, UserCountForm.class);
        return VOUtil.setJsonpResult(operateFansT2BizService.funcUserCount(form), jsonpcallback);
    }
    
    /**
     * 查询投顾登录日志信息
     * */
    @ResponseBody
    @RequestMapping("/func_broker_logger_qry")
    @SaveLog(remark = "查询投顾登录日志信息")
    public BrokerLoggerListResult funcBrokerLoggerQry(HttpServletRequest request, String jsonpcallback) {
        BrokerLoggerForm form = getSingleParameterMapForBody(request, BrokerLoggerForm.class);
        return VOUtil.setJsonpResult(operateBrokerT2.funcBrokerLoggerQry(form), jsonpcallback);
    }
    
    @ResponseBody
    @RequestMapping("/func_viewpoint_review_manange")
    @SaveLog(remark = "是否开启普通观点审核")
    public HSBCPSBackVO funcViewpointReviewManage(HttpServletRequest request, String jsonpcallback) {
        ViewPointReviewForm form = getSingleParameterMapForBody(request, ViewPointReviewForm.class);
        return VOUtil.setJsonpResult(viewpointManageT2.funcViewpointReviewManage(form), jsonpcallback);
    }

    @ResponseBody
    @RequestMapping("/func_viewpoint_review_status_manange")
    @SaveLog(remark = "获取普通观点审核配置")
    public ViewpointReviewData funcViewpointReviewStatusManange(HttpServletRequest request, String jsonpcallback) {
        ViewpointReviewManage form = getSingleParameterMapForBody(request, ViewpointReviewManage.class);
        return VOUtil.setJsonpResult(viewpointManageT2.funcViewpointReviewStatusManange(form), jsonpcallback);
    }

    @ResponseBody
    @RequestMapping("/func_viewpoint_list_manage")
    @SaveLog(remark = "获取普通观点管理列表")
    public ViewpointManangeResult funcViewpointListManage(HttpServletRequest request, String jsonpcallback) {
        SelfViewpointForm form = getSingleParameterMapForBody(request, SelfViewpointForm.class);
        return VOUtil.setJsonpResult(viewpointManageT2.funcViewpointListManage(form), jsonpcallback);
    }

    @ResponseBody
    @RequestMapping("/func_viewpoint_review_by_id_manage")
    @SaveLog(remark = "普通观点是否通过审核")
    public HSBCPSBackVO funcViewpointReviewByIdManage(HttpServletRequest request, String jsonpcallback) {
        ViewpointReviewManageForm form = getSingleParameterMapForBody(request, ViewpointReviewManageForm.class);
        return VOUtil.setJsonpResult(viewpointManageT2.funcViewpointReviewByIdManage(form), jsonpcallback);
    }

    @ResponseBody
    @RequestMapping("/func_viewpoint_operate_list_by_tenant")
    @SaveLog(remark = "管理中台观点列表页面")
    public ViewpointOperateList funcViewpointOperateListByTenant(HttpServletRequest request, String jsonpcallback) {
        BranchNoPageForm form = getSingleParameterMapForBody(request, BranchNoPageForm.class);
        return VOUtil.setJsonpResult(viewpointManageT2.funcViewpointOperateListByTenant(form), jsonpcallback);
    }

    @ResponseBody
    @RequestMapping("/func_viewpoint_comment_operate_list_by_tenant")
    @SaveLog(remark = "管理中台观点评论列表页面")
    public ViewpointCommentOperateList funcViewpointCommentOperateListByTenant(HttpServletRequest request, String jsonpcallback) {
        ViewpointCommentOperateListForm form = getSingleParameterMapForBody(request, ViewpointCommentOperateListForm.class);
        return VOUtil.setJsonpResult(viewpointManageT2.funcViewpointCommentOperateListByTenant(form), jsonpcallback);
    }

    @ResponseBody
    @RequestMapping("/func_viewpoint_comment_delete")
    @SaveLog(remark = "管理中台观点评论批量删除")
    public HSBCPSBackVO funcViewpointCommentDelete(HttpServletRequest request, String jsonpcallback) {
        ViewpointCommentOperateDeleteForm form = getSingleParameterMapForBody(request, ViewpointCommentOperateDeleteForm.class);
        return VOUtil.setJsonpResult(viewpointManageT2.funcViewpointCommentDelete(form), jsonpcallback);
    }
    @ResponseBody
    @RequestMapping("/func_chat_list_by_tenant")
    @SaveLog(remark = "获取直播列表")
    public ChatListResult funcChatListByTenant(HttpServletRequest request, String jsonpcallback) {
        SelfViewpointForm form = getSingleParameterMapForBody(request, SelfViewpointForm.class);
        return VOUtil.setJsonpResult(chatManageT2.funcChatListByTenant(form), jsonpcallback);
    }

    @ResponseBody
    @RequestMapping("/func_chat_content")
    @SaveLog(remark = "获取直播言论")
    public ChatContentResult funcChatContent(HttpServletRequest request, String jsonpcallback) {
        ChatContentForm form = getSingleParameterMapForBody(request, ChatContentForm.class);
        return VOUtil.setJsonpResult(chatManageT2.funcChatContent(form), jsonpcallback);
    }
    @ResponseBody
    @RequestMapping("/func_chat_content_info_get")
    @SaveLog(remark = "获取直播详情")
    public ChatMsgResult funcChatContentInfoGet(HttpServletRequest request, String jsonpcallback) {
        ChatContentInfoForm form = getSingleParameterMapForBody(request, ChatContentInfoForm.class);
        return VOUtil.setJsonpResult(chatManageT2.funcChatContentInfoGet(form), jsonpcallback);
    }
    @ResponseBody
    @RequestMapping("/func_batch_del_chat_content")
    @SaveLog(remark = "批量删除言论")
    public HSBCPSBackVO funcBatchDelChatContent(HttpServletRequest request, String jsonpcallback) {
        ChatBatchDelForm form = getSingleParameterMapForBody(request, ChatBatchDelForm.class);
        return VOUtil.setJsonpResult(chatManageT2.funcBatchDelChatContent(form), jsonpcallback);
    }

    @ResponseBody
    @RequestMapping("/func_self_viewpoint_list")
    @SaveLog(remark = "获取自媒体观点管理列表")
    public SelfViewpointResult funcSelfViewpointsList(HttpServletRequest request, String jsonpcallback) {
        SelfViewpointForm form = getSingleParameterMapForBody(request, SelfViewpointForm.class);
        return VOUtil.setJsonpResult(viewpointManageT2.funcSelfViewpointsList(form), jsonpcallback);
    }

    @ResponseBody
    @RequestMapping("/func_self_viewpoint_review")
    @SaveLog(remark = "是否开启自媒体观点审核")
    public HSBCPSBackVO funcSelfViewpointReview(HttpServletRequest request, String jsonpcallback) {
        SelfViewpointReviewForm form = getSingleParameterMapForBody(request, SelfViewpointReviewForm.class);
        return VOUtil.setJsonpResult(viewpointManageT2.funcSelfViewpointReview(form), jsonpcallback);
    }
    @ResponseBody
    @RequestMapping("/func_self_viewpoint_review_status")
    @SaveLog(remark = "自媒体观点是否通过审核")
    public HSBCPSBackVO funcSelfViewpointReviewStatus(HttpServletRequest request, String jsonpcallback) {
        SelfViewpointStatusForm form = getSingleParameterMapForBody(request, SelfViewpointStatusForm.class);
        return VOUtil.setJsonpResult(viewpointManageT2.funcSelfViewpointReviewStatus(form), jsonpcallback);
    }
}
